package org.mipt.infsec.steganography.impl.petzib.datastorage;

/**
 * Class override hashCode of java.lang.String
 */
public class String
{
    public java.lang.String value;

    public String(java.lang.String value)
    {
        this.value = value;
    }

    public int hashCode()
    {
        int result = 0;
        for (int i = 0; i < value.length(); i++)
            result += (int) value.charAt(i) - (int)'а';
        return result;
    }

    public boolean equals(Object obj)
    {
        if (!(obj instanceof String)) return false;

        String instance = (String)obj;
        if (this.value.equals(instance.value)) return true;
        return false;
    }


}
